package com.paw.ruoyi.admin.common.enums;

import java.util.Arrays;

import lombok.Getter;

/**
 * @author lvzihai
 * @date 2022/3/20
 **/
@Getter
public enum SysNormalDisableEnum implements ICommonEnum {

  /**
   * 正常，停用
   */
  Normal(0,"正常"),
  Disable(1,"停用")
  ;
  int code;
  String desc;


  SysNormalDisableEnum (int code, String desc) {
    this.code = code;
    this.desc = desc;
  }

  public static SysNormalDisableEnum getEnumByCode (Integer code) {
    if(code==null){
      return null;
    }
    return Arrays.stream(values()).filter(e->e.getCode()==code).findFirst().orElse(null);
  }

}
